export const defaultCascaderProps = {
    options: () => [],
};
export const defaultFieldKeys = {
    label: 'label',
    value: 'value',
    disabled: 'disabled',
    children: 'children',
};
export function getSelectedOptionsByValue(options, value, fieldKeys) {
    for (const option of options) {
        if (option[fieldKeys.value] === value) {
            return [option];
        }
        if (Array.isArray(option[fieldKeys.children])) {
            const selectedOptions = getSelectedOptionsByValue(option[fieldKeys.children], value, fieldKeys);
            if (selectedOptions) {
                return [option, ...selectedOptions];
            }
        }
    }
}
